#pragma once

#include <string>
#include <vector>
#include <SFML/Graphics.hpp>
#include "..\Drawing\TextureManager.hpp"
using namespace std;

/*
\class Tileset
\author Plomeg
\date Mar. 20th 2013
\version 0.2
\brief The tileset used by Map.
\details Its main purpose is to manage the tileset (the image).
*/

class Tileset
{
public:
	/*
	\brief 
	\param img The path to the image used.
	\details The size of the image is used to calculate the size of the tileset.
	*/
	void load(string img);
	/*
	\brief Brutally loads a collision mask on the tileset.
	\param path The path to collision mask.
	\details The mask is a succession of numbers used in the reading order : >0 for wall, 0 else
	*/
	void loadCollisionMask(string path);
	/*
	\brief Set the sprite for rendering.
	\param sprite The sprite to set.
	\param tile The number of the tile to set.
	*/
	void setSprite(sf::Sprite& sprite, unsigned int tile);
	/*
	\brief Is the tile a wall?
	\param tile The tile to check.
	*/
	bool checkColliding(unsigned int tile);

private:
	unsigned int m_width;
	unsigned int m_height;
	string m_img;
	sf::Texture* m_text;
	vector<unsigned int> m_collisionMask;
};
